package class_code.obj_4_Interface;

interface Animal {
    void eat();

    void run();
}

class Cat implements Animal {

    @Override
    public void eat() {
        System.out.println("小猫在吃饭");
    }

    @Override
    public void run() {
        System.out.println("小猫在跑");

    }
}

class Dog implements Animal {

    @Override
    public void eat() {
        System.out.println("小狗在吃饭");
    }

    @Override
    public void run() {
        System.out.println("小狗在跑");

    }
}


public class InterfaceDemo1 {
    public static void main(String[] args) {
        Cat c = new Cat();
        Dog d = new Dog();
        c.eat();
        d.eat();

    }
}
